Method and device for building a variable-length error code

ABSTRACT

The invention relates to a variable-length error-correcting (VLEC) code technique, in which the main steps are: defining all the needed parameters, generating a code having a fixed length L 1 , storing in a set W thus obtained all the possible L 1 −tuples distant of the minimum diverging distance d[min] from the codewords (one extra-bit being affixed at the end of all words if the new set W thus obtained is not empty), deleting all words of W that do not satisfy a distance criterion with all codewords, and verifying that all words of the final set W satisfy another distance criterion. According to the invention, it is proposed to realize the codeword deletion not anymore only in the last obtained groupe of the code, but in the group of a given length value Ls to which the algorithm will skip back to in the codeword deletion operation, which allows to go back very quickly to smaller lengths and skip many steps of the previous methods.

FIELD OF THE INVENTION

The present invention relates to a method of building a variable lengtherror code, said method comprising the steps of:

(1) initializing the needed parameters : minimum and maximum length ofcodewords L₁ and L_(max) respectively, free distance d_(free) betweeneach codeword (said distance d_(free) being for a VLEC code C theminimum Hamming distance in the set of all arbitrary extended codes),required number of codewords S;

(2) generating a fixed length code C of length L₁ and minimal distanceb_(min), with b_(min)=min {b_(k); k=1, 2 . . . , R}, b_(k)=the distanceassociated to the codeword length L_(k) of code C and defined as theminimum Hamming distance between all codewords of C with length L_(k),and R=the number of different codeword lengths in C, said generatingstep creating a set W of n-bit long words distant of d;

(3) listing and storing in the set W all the possible L₁—tuples at thedistance of d_(min) from the codewords of C (said distance d_(min) for aVLEC code C being the minimum value of all the diverging distancesbetween all possible couples of different-length codewords of C), and,if said set W is not empty, doubling the number of words in W byaffixing at the end of all words one extra bit, said storing steptherefore replacing the set W by a new one having twice more words thanthe previous one and the length of each one of these words being L₁+1;

(4) deleting all the words of the set W that do not satisfy the c_(min)distance with all codewords of C, said distance c_(min) being theminimum converging distance of the code C;

(5) in the case where no word is found or the maximum number of bits isreached, reducing the constraint of distance for finding more words;

(6) controlling that all words of the set W are distant of b_(min), thefound words being then added to the code C;

(7) if the required number of codewords has not been reached, repeatingthe steps (1) to (6) until the method finds either no furtherpossibility to continue or the required number of codewords;

(8) if the number of codewords of C is greater than S, calculating onthe basis of the structure of the VLEC code, the average length ALobtained by weighting each codeword length with the probability of thesource, said AL becoming the AL_(min), if it is lower than AL_(min),with AL_(min)=the minimum value of AL, and the corresponding codestructure being kept in memory.

The invention also relates to a corresponding device, allowing to carryout said building method.

BACKGROUND OF THE INVENTION

A classical communication chain, illustrated in FIG. 1, comprises, forcoding the signals coming from a source S, a source coder 1 (SCOD)followed by a channel coder 2 (CCOD) and, after the transmission of thecoded signals thus obtained through a channel 3, a channel decoder 4(CDEC) and a source decoder 5 (SDEC). The decoded signals are intendedto be sent towards a receiver. Variable-length codes (VLC) areclassically used in source coding for their compression capabilities,and the associated channel coding techniques combat the effects of thereal transmission channel (such as fading, noise, etc.). However, sincesource coding is intended to remove redundancy and channel coding tore-introduce it, it has been investigated how to efficiently coordinatethese techniques in order to improve the overall system while keepingthe complexity at an acceptable level.

Among the solutions proposed in such an approach, the variable-lengtherror correcting (VLEC) codes present the advantage to bevariable-length while providing error correction capabilities, butbuilding these codes is rather time consuming for short alphabets (andbecome even prohibitive for higher length alphabets sources), and theconstruction complexity is also a drawback, as it will be seen.

First, some definitions and properties of the classical VLC must berecalled. A code C is a set of S codewords {c₁, c₂, c₃, . . . , c_(i), .. . c_(s)}, for each of which a length l_(i)=|c_(i)| is defined, withl₁≦l₂≦l₃≦ . . . ≦_(i)≦ . . . ≦l_(s) fees without any loss of generality.The number of different codeword lengths in the code C is called R, withobviously R≦S, and these lengths are denoted as L₁, L₂, L₃, . . . L_(i),. . . L_(R), with L₁<L₂<L₃< . . . <L_(R). A variable-length code, orVLC, is then the structure denoted by (s₁@L₁, s₂@L₂, s₃@L₃, . . . ,s_(R)@L_(R)),which corresponds to s₁ codewords of length L₁, S₂codewords of length L₂, S₃ codewords of length L₃ , and s_(R) codewordsof length L_(R). When using a VLC, the compression efficiency, for agiven source, is related to the number of bits necessary to transmitsymbols from said source. The measure used to estimate this efficiencyis often the average length AL of the code, i.e. the average number ofbits needed to transmit a word, and said average length is given, wheneach symbol a; is mapped to the codeword c;, by the following relation(1): $\begin{matrix}{{AL} = {\sum\limits_{i = 1}^{i = s}{l_{i} \cdot {P\left( a_{i} \right)}}}} & (1)\end{matrix}$which is equivalent to the relation (2): $\begin{matrix}{{AL} = {\sum\limits_{i = 1}^{R}{L_{i} \cdot \left( {\sum\limits_{j = {{r{(i)}} + 1}}^{j = {r{({i + 1})}}}{P\left( a_{i} \right)}} \right)}}} & (2)\end{matrix}$where, for a data source A, the S source symbols are denoted by {a₁, a₂,a₃, . . . , a_(s)} and P(a_(i)) is the respective probability ofoccurrence of each of these symbols, with ΣP(a_(i))=1 (from i=1 to i=S).If AL_(min) denotes the minimal value for the average length AL, it iseasy to see that when AL_(min) is reached, the symbols are indexed insuch a way that P(a₁)≧P(a₂)≧P(a₃)≧ . . . ≧P(a_(i))≧ . . . P(a_(s)). Inorder to encode the data in such a way that the receiver can decode thecoded information, the VLC must satisfy the following properties: to benon-singular (all the codewords are distinct, i.e. no more than onesource symbol is allocated to one codeword) and to be uniquely decodable(i.e. it is possible to map any string of codewords unambiguously backto the correct source symbols, without any error).

An introduction and a presentation of different distances that areuseful when reviewing some general properties of the VLC codes will thenhelp to recall the notion of error-correcting property used in the VLECcode theory:

-   -   (a) Hamming weight and distance: if w is a word of length n with        w=(w₁, w₂, . . . , w_(n)), the Hamming weight of w, or simply        weight, is the number W(w) of non-zero symbols in w:        $\begin{matrix}        {{W(w)} = {\sum\limits_{i = 1}^{i = n}\frac{w_{i}}{w_{i}}}} & (3)        \end{matrix}$        and, if w₁ and w₂ are two words of equal length n with        w_(i)=(w_(i1), w_(i2), w_(i3), . . . , w_(in)) and i=1 or 2, the        Hamming distance (or, simply, distance) between w₁ and w₂ is the        number of positions in which w₁ and w₂ differ (for example, for        the binary case, it is easy to see that:        H(w ₁ ,w ₂)=W(w ₁ +w ₂)  (4)        where the addition is modulo-2). However, the Hamming distance        is by definition restricted to fixed-length codes, and other        definitions will be defined before considering VLEC codes.

(b) let f_(i)=w₁ ¹ w₂ ^(i) . . . w_(n) ^(i) be a concatenation of nwords of a VLEC code C, then the set F_(N)={f_(i): |f_(i)|=N} is calledthe extended code of C of order N.

(c) minimum block distance and overall minimum block distance: theminimum block distance b_(k) associated to the codeword length L_(k) ofa VLEC code C is defined as the minimum Hamming distance between alldistinct codewords of C with the same length L_(k):b _(k)=min{H(c _(i) , c _(j)):c _(i) ,c _(j) εC,i≠j,|c _(i) |=|c _(j)|=L _(k)} for k=1, . . . , R  (5)and the overall minimum block distance b_(min) of said VLEC code C,which is the minimum block distance value for every possible lengthL_(k), is defined by:b _(min)=min{b _(k) :k=1, . . . R}  (6)

(d) diverging distance and minimum diverging distance: the divergingdistance between two codewords of different lengthc_(i) − x_(i₁)x_(i₂)  …  x_(i_(l_(i)))  and  c_(j) = x_(j1)x_(j2)  …  x_(j_(l₁))of a VLEC code C, where c_(i), c_(j)εC,l_(i)=|c_(j)| and l_(j)=|c_(j)|with l_(i)>l_(j), is defined by: $\begin{matrix}{{D\left( {c_{i},c_{j}} \right)} = {H\left( {{x_{i_{1}}x_{i_{2}}\quad\ldots\quad x_{i_{l_{1}}}},{x_{j_{1}}x_{j_{2}}\quad\ldots\quad x_{j_{l_{2}}}}} \right)}} & (7)\end{matrix}$i.e. it is also the Hamming distance between a l_(j)−length codeword andthe l_(j)—length prefix of a longer codeword, and the minimum divergingdistance d_(min) of said VLEC code C is the minimum value of all thediverging distances between all possible couples of codewords of C ofunequal length:d_(min)=min {D(c_(i),c_(j)):c_(i),c_(j)∈C,|c_(i)|≠|c_(j)|}  (8)

(e) converging distance and minimum converging distance: the convergingdistance between two codewords of different lengthc_(i) = x_(i₁)x_(i₂)  …  x_(i_(l₁))  and  c_(j) = x_(j1)x_(j2)  …  x_(j_(l₁))of a VLEC code C, where |c_(i)|=l_(i)>|c_(j)|=l_(j), is defined by:$\begin{matrix}{{C\left( {c_{i},c_{j}} \right)} = {H\left( {{x_{i_{l_{i} - l_{j + 1}}}x_{i_{l_{i} - l_{j + 2}}}\cdots\quad x_{i_{l_{i}}}},{x_{j_{1}}x_{j_{2}}\cdots\quad x_{j_{l_{j}}}}} \right)}} & (9)\end{matrix}$i.e. it is also the Hamming distance between a l_(j)—length codeword andthe l_(j)—length suffix of a longer codeword, and the minimum convergingdistance of said VLEC code C is the minimum value of all the convergingdistances between all possible couples of C of unequal length:c _(min)=min{C(c _(i) ,c _(j)):c _(i) ,c _(j) εC,|c _(i) |≠|c_(j)|}  (10)

(f) free distance: the free distance d_(free), of a code is the minimumHamming distance in the set of all arbitrary long paths that divergefrom some common state S_(i) and converge again in another common stateS_(j), with j>i:d _(free)=min{H(f _(i) ,f _(j)):f _(i) ,f _(j) εF _(N) , N=1,2, . . .,∞}  (11)

Following the structure model used for a VLC, it is therefore possibleto describe the structure of the VLEC code C by the notation:S₁@L₁,b₁,S₂@L₂,b₂, . . . ;S_(r)@L_(R),b_(R);d_(min), c_(min)  (12)where there are s_(i) codewords of length L_(i) with minimum blockdistance b_(i), for all i=1, 2, . . . R, (it is recalled that R is thenumber of different codeword lengths) and minimum diverging andconverging distances d_(min) and c_(min). The most important parameterof a VLEC code is its free distance d_(free), which influences greatlyits performance in terms of error-correcting capabilities, and it can beshown that the free distance of a VLEC code is bounded by:d _(free)≧min(b _(min) ,d _(min) +c _(min))  (13)

These definitions being recalled, the state-of-the-art in VLEC codesconstruction will be now described more easily. The first types of VLECcodes, called α-prompt codes and introduced in 1974, and an extension ofthis family, called α_(t) ₁ _(,t) ₂ _(, . . . ,t) _(R) -prompt codes,have both the same essential property: if one denotes by α(c_(i)) theset of words that are closer to c_(i) than to any codeword c_(j), with j≠i, no sequence in α(c_(i)) is a prefix of a sequence in anotherα(c_(i)) . The construction of these codes is very simple, and theconstruction algorithm is adjustable by the number of codewords at eachlength, which makes possible to find the best prompt code for a givensource and a given d_(free). However, this best code performs poorly interms of compression performance.

A more recent construction, allowing the construction of a VLEC codefrom the generator matrix of a fixed-length linear block code, wasproposed in the document “Variable-length error-correcting codes” by V.Buttigieg, Ph.D. Thesis, University of Manchester, England, 1995. Calledcode-anticode construction, this algorithm relies on line combinationsand column permutations to form an anticode at the rightmost column.Once the code-anticode generator matrix is obtained, the VLEC code issimply obtained by a matrix multiplication.

This technique has however several drawbacks. First, there is noexplicit method to find the needed line combinations and columnpermutations to obtain the anticode. Moreover, the construction does nottake into account the source statistics and, consequently, often revealsitself sub-optimal (one can find a code with smaller average length by apost-processing on the VLEC code). In the same document, the author hasthen proposed an improved method, called Heuristic method, that is basedon a computer search for building a VLEC code giving the better knowncompression rate for a specified source and a given protection againsterrors, i.e. a code C with specified overall minimum block, divergingand converging distances (and hence a minimum value for d_(free) ) andwith codeword lengths matched to the source statistics so as to obtain aminimum average codeword length for the chosen free distance and thespecified source (in practice, one takes:b_(min)=d_(min)+c_(min)=d_(free), and: d_(min)=[d_(free)/2].

The main steps of this Heuristic method, which uses the followingparameters: minimum length L₁ of codewords, maximum length L_(max) ofcodewords, free distance d_(free) between each codeword, number S ofcodewords required, are now described with reference to the flowchartsof FIGS. 2 to 4.

To start the computer search (“Start”), all the needed parameters mustbe first specified: L₁ (the minimum codeword length, which must be atleast equal to or greater than the minimum diverging distance required),L_(max) (the maximum codeword length), the different distances betweencodewords (d_(free), b_(min), d_(min), c_(min)), and S (the number ofcodewords required by the given source), and some relations are set whenchoosing these parameters:L_(l)≧d_(min)b_(min)=d_(free)d _(min) +c _(min) =d _(free)

The first phase of the algorithm, referenced 11, is then performed: itconsists in the generation of a fixed length code (put initially in C)of length L₁ and minimal distance b_(min), with a maximum number ofcodewords. This phase is in fact an initialization, performed forinstance by means of an algorithm such as the greedy algorithm (GA),presented in FIG. 5, or the majority voting algorithm (MVA), presentedin FIG. 7, or a new proposed variation, denoted by GAS (Greedy Algorithmby Step), which consists of a variation of the two above mentioned ones.The GAS consists in the search method used in the GA, where instead ofdeleting half of the codewords, only the last codeword of the group isdeleted. These two algorithms are useful to create a set W of n-bit longwords distant of d (in practice, it may be noted that the MVA finds morewords than the GA, but it asks too much time for only a smallimprovement of the compression capacity, as shown in the tables of FIGS.6 and 8, which compare, respectively for the GA and for the MVA, thebest code structures obtained with different values of d_(free) for the26-symbol English source defined in the table of FIG. 9.

The second phase of the algorithm, corresponding to the elementsreferenced 21 to 24 (21+22=operation “A0”; 23+24 =operation “A2”) inFIG. 2, consists in listing and storing (step 21) in a set called W allthe possible L₁−tuples at the distance of d_(min) from the codewords inC. If d_(min)≧b_(min), then W is empty. If this set W of all the wordssatisfying the minimum diverging distance to the current code is notempty (reply NO to the test 22: |W|=0 ?), the number of words in W isdoubled by increasing the length of the words by one bit by affixingfirst a “0” and then a “1” to the rightmost position of all the words inW (step 24), except if the maximum number of bits is exceeded (reply YESto the test 23). At the output of said step 24, this modified set W hastwice more words than the previous W, and the length of each one isL₁+1.

The third phase of the algorithm, corresponding to the elements 31 to 35(=operation “A3” in FIG. 2), consists in deleting (step 31) all thewords of set W that do not satisfy the c_(min) distance (minimumconverging distance) with all the codewords of C (i.e. in keeping andstoring in a new W only the words which satisfy said minimum convergingdistance, the other ones being discarded). At this point, the new set Wis a set of words which, when compared to the codewords of C, satisfythe required minimum diverging and converging distances (both d_(min)and c_(min) distances) with the codewords of C. If that new set W is notempty (reply NO to the test 32: |W|=0 ?) one selects in W (step 33) themaximum number of words to satisfy the minimum block distance, in orderto ensure that all the words of the set W, being of the same length,have a minimum distance at least equal to b_(min). At the end of thisstep 33, realized with the GA or the MVA (note that in this case, theinitial set used for the GA or the MVA is the current W and not an−tuples set), the words thus obtained are added (step 34) to thecodewords already in C.

If no word is found (i.e. W is empty) at the end of the step 21 (replyYES to the test 22: |W|=0 ?) or if the maximum number of bits is reachedor exceeded (reply YES to the test 23), one enters the fourth phase ofthe algorithm (steps 41 to 46, illustrated in FIG. 3 and also designatedby the operation “A1” in said figure), which is used in order to unjamthe process by inserting more liberty of choice, more particularly byaffixing to all words in W extra bits (several bits at the same time)such that the new group contains more bits than the old one. If thereare enough codewords in the last group (successive tests 41 and 42, forverifying the number of codewords in the last group, and if there areprevious groups), some of them are deleted from said group (as describedabove), such deletions allowing to reduce the distance constraint and tofind more codewords than before. As a matter of fact, the classicalHeuristic method thus described begins with the maximum of codewordswith the short length, maps them with the high probability symbols andtries to obtain a good compression rate, but sometimes the size of thesmall lengths sets are incompatible with the required number ofcodewords S. In this optic, easing a few codewords provides more freedomdegrees and allows to reach a position where the initial requirements ondistance and number of symbols for the code can be met. This deletionprocess is repeated until it remains a maximum of one codeword for eachlength. If W is empty at the end of the step 31 (reply YES to the test32: |W|=0 ?), the steps 23, 24, 31, 32 are repeated. If the requirednumber of codewords has not been reached (reply NO to the test 35provided at the end of this third phase), the steps 21 to 24 and 31 to35 must be repeated until said steps find that either there are nofurther possible words to be found or the required number of codewordsis reached.

If said required number of codewords has been reached (i.e. the numberof codewords of C is equal to or greater than S (reply YES to the test35), the structure of the VLEC code thus obtained is used in a fifthpart, including the steps 51 to 56 (illustrated in FIG. 4, and alsodesignated by the operation “A4” in said figure), in order to calculatethe average length AL. This is done by weighting each codeword lengthwith the probability of the source, and comparing it to the current bestone. If said average length AL of this VLEC code is lower than theminimized value of AL (=AL_(min)), this AL becomes the AL_(min), andthis new AL value and the corresponding code structure are kept in thememory (step 51). These steps 51 and following (fifth part; operation“A4”) allow to come back, within the algorithm, towards previous groups,while the other phases of said algorithm are always performed on thecurrent group. The stepsize for such a feedback operation is one, i.e.this feedback action can be considered as exhaustive.

To continue this search of the best VLEC code, it is necessary to avoidkeeping the same structure, which would lead to a loop in the algorithm.The last added group of the current code is deleted (steps 52, 53), thedeletion of shorter length codewords allowing to find more longer lengthcodewords (test 54: number of codewords in group greater than 1 ?), andsome codewords (half the amount for the GVA; the “best” one for the MVA)of the previous group are deleted (step 55), in order to re-loop (step56) the algorithm at the beginning of the step 21 (see FIG. 2) and finddifferent VLEC structures (the number of deleted codewords depends onwhich method is used for selecting the words: if the GA method is usedand one wants to obtain a linear code, it is necessary to delete half ofthe codewords, while with the MVA method only one codeword, the bestone, is deleted, i.e. the one that allows to find the more codewords inthe next group).

However, the Heuristic method thus described often considers veryunlikely code structures or proceeds with such a care (in order not tomiss anything) that a great complexity is observed in the implementationof said method, which moreover is rather time consuming and can thusbecome prohibitive. It has therefore been proposed in a European patentapplication filed on Oct. 23, 2002, with the filing number 02292624.0(PHFR020110), an improved construction method with which it is possibleto gain in complexity by avoiding these drawbacks, said method ofbuilding a variable length error code comprising, more precisely, thesteps of:

(1) initializing the needed parameters: minimum and maximum length ofcodewords L₁ and L_(max) respectively, free distance d_(free) betweeneach codeword (said distance d_(free) being for a VLEC code C theminimum Hamming distance in the set of all arbitrary extended codes),required number of codewords S;

(2) generating (step 11) a fixed length code C of length L₁ and minimaldistance b_(min), with b_(min)=min {b_(k); k=1, 2 . . . , R}, b_(k)=thedistance associated to the codeword length L_(k) of code C and definedas the minimum Hamming distance between all codewords of C with lengthL_(k), and R=the number of different codeword lengths in C, saidgenerating step 11 creating a set W of n-bit long words distant of d;

(3) listing and storing (step 21) in the set W all the possibleL₁×tuples at the distance of d_(min) from the codewords of C (saiddistance d_(min) for a VLEC code C being the minimum value of all thediverging distances between all possible couples of different-lengthcodewords of C), and, if said set W is not empty, doubling the number ofwords in W by affixing at the end of all words one extra bit, saidstoring step therefore replacing the set W by a new one having twicemore words than the previous one and the length of each one of thesewords being L₁+1;

(4) deleting (step 31) all the words of the set W that do not satisfythe c_(min) distance with all codewords of C, said distance c_(min)being the minimum converging distance of the code C;

(5) in the case where no word is found or the maximum number of bits isreached, reducing (step 41) the constraint of distance for finding morewords;

(6) controlling that all words of the set W are distant of b_(min), thefound words being then added to the code C (step 34);

(7) if (step 35) the required number of codewords has not been reached,repeating the steps (1) to (6) (i.e. the steps 21 to 35) until themethod finds either no further possibility to continue or the requirednumber of codewords;

(8) if the number of codewords of C is greater than S, calculating(phase A4), on the basis of the structure of the VLEC code, the averagelength AL obtained by weighting each codeword length with theprobability of the source, said AL becoming the AL_(min), if it is lowerthan AL_(min), with AL_(min)=the minimum value of AL, and thecorresponding code structure being kept in memory;

said building method being moreover such that at most one bit is addedat the end of each word of the set W.

Simulations show that, with the classical Heuristic method, almost noneof the obtained best codes has a hole (i.e. a length jump in itsstructure length), while it is considered, in the cited document, thatmost good codes do not have jump of length and, therefore, that the setof examined VLEC codes can be reduced accordingly (which reduces thesimulation time and the complexity of implementation of the method,without modifying much the AL). Following this hypothesis, the methodis, in the EP document cited above, modified by avoiding to add morethan one bit at the end of each word of the set W. In this newstructure, the circuit 45 has been cancelled, which means that it is nolonger allowed to affix several extra bits to the words, but only one,which leads, with respect to FIG. 3, to a simpler phase A1 (FIG. 11).The corresponding implementation (improved Heuristic constructionmethod, also called “noHole optimization method”) is illustrated inFIGS. 10 and 11, which show the two parts of a flowchart correspondingto said method (the elements that are identical to the ones observed inFIGS. 2 to 4 being designated with the same references). With respect tothe flowchart of FIGS. 2 to 4, the parts that, with respect to theclassical Heuristic technique, are useless for the implementation of theimproved method have been cancelled:

(a) if W is empty at the end of the step 31 (reply YES to the test 32:|w|=0 ?), the next phase is now (see FIG. 10) not the repetition of thesteps (23, 24, 31, 32), but, according to said “noHole” method, theestablishment (in place of said repetition) of a direct connection 91towards the input of the circuit carrying out the operation 55 (deletionof some codewords, or of the best one, before a global repetition of thesteps 21 to 24 and 31 to 35), said operation 55 being then, aspreviously, followed by the operations 21 and following.

(b) the fourth phase of the method is now reduced to one step, theoperation 41, which is the test “Number of codewords in last group=1 ?”.If the reply is NO, a direct link is established with the input of thestep 55 (connection 91), in view of carrying out said operation 55, andthen the operations 21 and following. If the reply is YES, a connection92 is established with the input of the set of operations 52 to 54.

The results thus obtained are presented in the table of FIG. 12 for the26 symbol English source when using the GAS method for selectingcodewords. It can be seen, when comparing with results presented in FIG.13, that although the result is not completely optimal for d_(free)=3(the code structure has a hole at length L=11), the AL rise is reallyacceptable when one considers that there is both strictly no degradationfor the other d_(free) values and a gain of time between 2,5 and 4. Thesame remarks can be applied when comparing the present solution with theones obtained in FIG. 7, where the MVA complexity effect is clear.Similarly, applying the noHole optimisation with the GA method forselecting codewords leads to a time gain at the only expense of a slightAL rise for d_(free)=3. Finally, FIG. 5 shows on the other hand that thecurrent solution offers better AL for an acceptable gain of time, thenoHole optimisation compensating almost entirely the complexity inducedby the GAS. However, with the method thus described in the EP document,there are cases where there are too many small length codewords in thegenerated VLEC code.

SUMMARY OF THE INVENTION

It is therefore an object of the invention to propose an improvedconstruction method with which it is possible to go back very quickly tosmaller lengths and skip many algorithm steps (in cases where thealgorithm would have painfully got stick with too many codewords ofsmall lengths).

To this end, the invention relates to a method such as defined in theintroductory part of the description and which is moreover characterizedin that the deletion is realized not only in the last obtained group butalso in the group of a given length value in order to go back veryquickly to smaller lengths.

According to a possible improved implementation of the invention, theinvention relates to a similar method (i.e. also such as defined in theintroductory part of the description), but which is now preferablycharacterized in that at most one bit is added at the end of each wordof the set W and the deletion is moreover realized not only in the lastobtained group but also in the group of a given length value in order togo back very quickly to smaller lengths.

It is also an object of the invention to propose a device for carryingout said construction method.

To this end, the invention relates to a device for carrying out avariable length error code building method according to anyones of thetwo solutions thus proposed.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention will now be described, by way of example, withreference to the accompanying drawings in which:

FIG. 1 depicts a conventional communication channel;

FIGS. 2 to 4 are the three parts of a single flowchart illustrating themain steps of a conventional method used for building a VLEC code (andcalled Heuristic method);

FIG. 5 illustrates an algorithm (called greedy algorithm, or GA) usedfor the initialization of the method of FIGS. 2 to 4, and FIG. 6 is atable giving various VLEC codes for a source constructed with theHeuristic construction using said algorithm of FIG. 5;

FIG. 7 illustrates another algorithm (called majority voting algorithm,or MVA) used for the initialization of the method of FIGS. 2 to 4, andFIG. 8 is another table giving various VLEC codes for a sourceconstructed with the Heuristic construction using said algorithm of FIG.7;

FIG. 9 is a table giving for the 26-symbol English source thecorrespondence between the source symbol and its probability;

FIGS. 10 and 11 are the two parts of a single flowchart illustrating animplementation of an improvement of the conventional method illustratedin FIGS. 2 to 4;

FIG. 12 is another table giving various VLEC codes for the same 26symbol English source as considered in the tables of FIGS. 6 and 8 andusing the GAS;

FIG. 13 is another table giving various VLEC codes for the same sourceas in FIG. 12 and using both the GAS previously mentioned and thebuilding method according to the invention;

FIG. 14 shows the modification of the flowchart of FIG. 11 when themethod according to the invention is carried out;

FIG. 15 is a table illustrating the results obtained for the 26-symbolEnglish source when the method according to the invention is carriedout;

FIG. 16 is a table illustrating similarly the results obtained foranother source.

DETAILED DESCRIPTION OF THE INVENTION

Considering the evolution of the codewords stack in the classicalHeuristic process previously recalled, it may be proposed to perform thecodeword deletion not only in the last obtained codewords group, butmore generally in any given length value group, in order to makepossible to go back directly to smaller lengths, i.e. to skip manyalgorithm steps in cases where there are too many small lengthcodewords.

Denoting by L_(s) (with s for: skip) the length to which the algorithmwill skip back to in the codeword deletion stage, it is thereforeproposed, in the present so-called L_(s) optimization, to skip parts ofthe original Heuristic algorithm by carefully jumping to lower lengthswhen looking for codewords to be deleted (however, when the consideredcodewords group length L is smaller than L_(s), the classical method isobviously applied and the deletion is done within the group of lengthL). With respect to the previous fifth part (phase A4) of the “noHole”and “Heuristic” methods, the process is no longer exhaustive: it meansthat it is possible to come back more quickly towards previous groups,up to a target length L_(s) in order to avoid to spend too much timewith said feedback operations. As indicated, the classical method ishowever maintained for lengths lower than L_(s). The lengths comprisedbetween L₁ and L_(s) are consequently called “free lengths”, i.e.lengths with a freedom degree, as they are decremented one by one in thesearch process (when the number of free lengths grows up, the simulationtime also increased, exponentially).

The method according to the invention is called “L_(s) optimization” andis depicted in the flowchart formed by the association of FIG. 10(unchanged part of the previous method, the so-called noholeoptimization method) and FIG. 14 (modified part of the noHoleoptimization method), said FIG. 14 being adapted from FIG. 11 by meansof an introduction of the technical measures proposed above.

According to said measures, the last added group of the current code isdeleted, but only if (test 61) the codeword length CL of this previousgroup is lower (reply NO to the test 61) than or equal to L_(s) (thesteps that follow the test 61 are then the same as previously: steps 53,54, and 55 or 52 at the output of the test 54). If said codeword lengthis greater than Ls (reply YES to the test 61), an additional step 62 isprovided for going to group with L_(s)-bit long codewords and deletingall groups with more than L_(s) bits. At the output of the step 62, thesame steps 54, 55 as previously are provided.

In practice, simulation results show that very good compression ratescan be obtained for L_(s)<L(max), where L(max) is the maximal authorizedcodeword length (it can be noted that increasing the value of L_(s)results in an improvement of the AL value until a constant floor—thebest value—is reached, and this behaviour then suggests a possibledynamic choice of L_(s), starting with L_(s)=L₁ and incrementing ituntil said floor is reached). The results obtained for the 26-symbolEnglish source are presented in the table of FIG. 15 (crosses indicateimpossible values for L_(s), which must belong to the interval[L₁L(max)], and the mention “no code” corresponds to the cases where atoo short value of L_(s) resulted in a failure of the algorithm, i.e. noVLEC code verifying the initial parameters could be found). Comparingthose results with the ones of the table of FIG. 12 leads to observe anoticeable time gain, from about 5 at d_(free)=3 to about 2500 atd_(free)=7. The gain in computation time offered by the present L_(s)optimization algorithm also allows to find VLEC codes for the 208-symbolMPEG-4 source, as illustrated in the table of FIG. 16, where the resultshave been obtained using an algorithm including both the GAS and thenoHole and L_(s) optimizations.

It must be understood that the method according to the invention is notlimited to the aforementioned implementation. Another implementation canfor instance correspond to the addition of the features of the “noHole”method and the present “L_(s) optimization” method: in this case, themethod according to the invention is then such that at most one bit isadded at the end of each word of the set W and, in the same time, thedeletion is realized not only in the last obtained group but also in thegroup of a given length value in order to go back very quickly tosmaller lengths.

1. A method of building a variable length error code, said methodcomprising the steps of (1) initializing (phase 0) the needed parametersminimum and maximum length of codewords L₁ and L_(max) respectively,free distance d_(free) between each codeword (said distance d_(free)being for a VLEC code C the minimum Hamming distance in the set of allarbitrary extended codes), required number of codewords S; (2)generating (phase 1) a fixed length code C of length L₁ and minimaldistance b_(min), with b_(min)=min {b_(k); k=1, 2, . . . , R}, b_(k)=thedistance associated to the codeword length L_(k) of code C and definedas the minimum Hamming distance between all codewords of C with lengthL_(k), and R=the number of different codeword lengths in C, saidgenerating step creating a set W of n-bit long words distant of d; (3)storing (phase 2) in the set W all the possible L₁−tuples distant ofd_(min) from the codewords of C (said distance d_(min) for a VLEC code Cbeing the minimum value of all the diverging distances between allpossible couples of different-length codewords of C), and, if said set Wis not empty, affixing at the end of all words one extra bit, saidstoring step replacing the set W by a new one having twice more wordsthan the previous one and the length of each one of these words beingL₁+1; (4) deleting (phase 3) all the words of the set W that do notsatisfy the cmin distance with all codewords of C, said distance c_(min)being the minimum converging distance of the code C; (5) in the casewhere no word is found or the maximum number of bits is reached,reducing (phase A1) the constraint of distance for finding more words;(6) controlling that all words of the set W are distant of b_(min), thefound words being then added to the code C; (7) if the required numberof codewords has not been reached, repeating the steps (1) to (6) untilthe method finds either no further possibility to continue or therequired number of codewords; (8) if the number of codewords of C isgreater than S, calculating, on the basis of the structure of the VLECcode, the average length AL obtained by weighting each codeword lengthwith the probability of the source, said AL becoming the AL_(min) if itis lower than AL_(min), with AL_(min)=the minimum value of AL, and thecorresponding code structure being kept in memory; said building methodbeing such that the deletion is realized not only in the last obtainedgroup but also in the group of a given length value in order to go backvery quickly to smaller lengths.
 2. A method of building a variablelength error code, said method comprising the steps of : (1)initializing (phase 0) the needed parameters minimum and maximum lengthof codewords L₁ and L_(max) respectively, free distance d_(free) betweeneach codeword (said distance d_(free) being for a VLEC code C theminimum Hamming distance in the set of all arbitrary extended codes),required number of codewords S; (2) generating (phase 1) a fixed lengthcode C of length L₁ and minimal distance b_(min), with b_(min)=min{b_(k); k=1, 2, . . . , R}, b_(k)=the distance associated to thecodeword length L_(k) of code C and defined as the minimum Hammingdistance between all codewords of C with length L_(k), and R=the numberof different codeword lengths in C, said generating step creating a setW of n-bit long words distant of d; (3) storing (phase 2) in the set Wall the possible L₁-−tuples distant of d_(min) from the codewords of C(said distance d_(min) for a VLEC code C being the minimum value of allthe diverging distances between all possible couples of different-lengthcodewords of C), and, if said set W is not empty, affixing at the end ofall words one extra bit, said storing step replacing the set W by a newone having twice more words than the previous one and the length of eachone of these words being L₁+1; (4) deleting (phase 3) all the words ofthe set W that do not satisfy the cmin distance with all codewords of C,said distance c_(min) being the minimum converging distance of the codeC; (5) in the case where no word is found or the maximum number of bitsis reached, reducing (phase A1) the constraint of distance for findingmore words; (6) controlling that all words of the set W are distant ofb_(min), the found words being then added to the code C; (7) if therequired number of codewords has not been reached, repeating the steps(1) to (6) until the method finds either no further possibility tocontinue or the required number of codewords; (8) if the number ofcodewords of C is greater than S, calculating, on the basis of thestructure of the VLEC code, the average length AL obtained by weightingeach codeword length with the probability of the source, said ALbecoming the AL_(min), if it is lower than AL_(min), with AL_(min)=theminimum value of AL, and the corresponding code structure being kept inmemory; said building method being such that at most one bit is added atthe end of each word of the set W, and the deletion is moreover realizednot only in the last obtained group but also in the group of a givenlength value in order to go back very quickly to smaller lengths.
 3. Adevice for carrying out a variable length error code building methodaccording to claim 1.